public class Numbers
{
   /**
      Computes the length of the longest run (sequence of 
      adjacent repeated values) in an array.
      @param values an array of integer values
      @return the length of the longest run in values
   */
   public int lengthOfLongestRun(int[] values)
   {
      // your work here
      int ans=1,t=-1;
      int maxLen=0;
      for(int i=0;i<values.length;i++){
         if(values[i]==t){
            ans++;
         }else{
            ans=1;
            t=values[i];
         }
         maxLen=ans>maxLen?ans:maxLen;
      }
      return maxLen;

   }
}